//
//  FGMyCenterModel.swift
//  FlagApp
//
//  Created by momo on 2020/12/31.
//

import UIKit

class FGMyCenterModel: NSObject {

    var titleStr: String?
    var imageName: String?
    var type: UserCenterServiceType!
    
    lazy var serviceArr: Array = {
        () -> Array<Any> in
        let dataArr = [
            ["title":"我的收藏","img":"tabbar_classify_select","type":UserCenterServiceType.ServiceCollectionType],
                       ["title":"历史记录","img":"tabbar_classify_select","type":UserCenterServiceType.ServiceHistoricalRecordType],
                       ["title":"我的组队","img":"tabbar_classify_select","type":UserCenterServiceType.ServiceMyGroupType],
                       ["title":"管家1对1","img":"tabbar_classify_select","type":UserCenterServiceType.ServiceHousekeeperType],
                       ["title":"福利中心","img":"tabbar_classify_select","type":UserCenterServiceType.ServiceWelfareType],
                       ["title":"帮助中心","img":"tabbar_classify_select","type":UserCenterServiceType.ServiceHelpType],]
        return dataArr
    }()
    
    func myCenterServiceData() -> Array<Any> {
        let muarr = NSMutableArray()
        for dic in serviceArr {
            let model = self.modeWidthDic(dic: dic as! NSDictionary)
            muarr.add(model)
        }
        return muarr as! Array<Any>
    }
    
    func modeWidthDic(dic: NSDictionary) -> FGMyCenterModel {
        
        let model = FGMyCenterModel()
        model.titleStr = dic.object(forKey: "title") as? String
        model.imageName = dic.object(forKey: "img") as? String
        model.type = dic.object(forKey: "type") as? UserCenterServiceType
        
        return model
    }
    
}
